package com.cskaoyan.mall.dao;

import com.cskaoyan.mall.model.po.*;
import com.cskaoyan.mall.model.vo.goods.*;
import com.cskaoyan.mall.model.vo.order.OrderMessageVo;
import com.cskaoyan.mall.model.vo.user.UserMessageVo;

import java.util.List;

/**
 * @ClassName: GoodsMapper
 * @Description: TODO
 * @Auther 庄左
 * @Date 2022/6/30 10:03
 * @Version
 **/
public interface GoodsMapper {

    List<GoodsTypeVo> selectTypeById(Integer id);

    //通过type的id查找该type的所有商品
    List<GoodsMessageVo> selectGoodsByType(Type type);

    void addType(Type type);

    void addGoods(Goods goods);

    void insertSpec(List<Spec> spec);

    //编辑商品信息之后的保存更新
    void selectUpdateGood(Goods goods);

    void selectUpdateGoodSpec(Spec spec);

    GoodVo selectGood(Integer id);

    List<SpecVo> selectSpec(Integer id);

    void deleteGoods(Integer id);


    void deleteSpec(Spec spec);


    void deleteType(Integer id);

    //根据商品id查找商品信息,规格列表，列表之前已经查过，直接复用即可
    GoodVo selectGoodByGoodsIdInmall(Integer id);


    //根据商品id查找该商品的所有评论
    List<CommentVo> selectGoodsCommentByGoodsId(Integer goodsId);

    int insertGoodsMsg(GoodsMsg goodsMsg);

    String selectGoodsNameByGoodsId(Integer goodsId);

    Integer selectUserIdByUserNickName(String token);

    List<GoodsSearchVo> selectGoodsByGoodsName(String keyword);

    // UserMessageVo selectUserNickNameByUserId(Integer userId);

    // OrderMessageVo selectUserIdByOrderIdInOrder(Integer userId);


    // UserMessageVo selectUserNickNameByUserId(Integer commentId);
}
